
//全局方法定义名称
var getRequest;
var postRequest;


//操作请求get方法-json
getRequest = function(url,param,successCallback,failureCallback){
	$.ajax({
        type: "GET",
        url: url,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify(param),
        dataType: "json",
        success: function (message) {
        	successCallback();
        },
        error: function (message) {
        	failureCallback();
        }
    });
}

//操作请求POST方法-json
postRequest = function(url,param,successCallback,failureCallback){
	$.ajax({
        type: "POST",
        url: url,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify(param),
        dataType: "json",
        success: function (result) {
        	if(result.code == 200){
        		successCallback(result);
        	}else{
            	failureCallback(result);
        	}
        },
        error: function (result) {
        	failureCallback(result);
        }
    });
}